import pages from "@/router/pages";
import views from "@/router/views";
import {
    createRouter,
    createWebHistory,
    NavigationGuardNext,
    RouteLocationNormalized,
    Router,
    RouteRecordRaw
} from "vue-router";

const routes: Array<RouteRecordRaw> = [...pages, ...views]
const router: Router = createRouter({
    history: createWebHistory(), routes
})
router.beforeEach((to: RouteLocationNormalized, from: RouteLocationNormalized, next: NavigationGuardNext): void => {
    console.log(`${from.path}=>${to.path}`)
    next()
})
export default router